package io.renren.modules.basic.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;
import io.renren.modules.basic.dao.MtCcTaskRunInfoDao;
import io.renren.modules.basic.entity.MtCcTaskRunInfoEntity;
import io.renren.modules.basic.service.MtCcTaskRunInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;




@Service("mtCcTaskRunInfoService")
public class MtCcTaskRunInfoServiceImpl extends ServiceImpl<MtCcTaskRunInfoDao, MtCcTaskRunInfoEntity> implements MtCcTaskRunInfoService {

    @Autowired
    private MtCcTaskRunInfoDao mtCcTaskRunInfoDao;

    @Override
    public List<MtCcTaskRunInfoEntity> queryPage(Map<String, Object> params) {

        /*IPage<MtCcTaskRunInfoEntity> page = this.page(
                new Query<MtCcTaskRunInfoEntity>().getPage(params),
                new QueryWrapper<MtCcTaskRunInfoEntity>().allEq(params,false).orderByAsc("order")
        );*/

        List<MtCcTaskRunInfoEntity> mtCcTaskRunInfoEntities = mtCcTaskRunInfoDao.selectList(new QueryWrapper<MtCcTaskRunInfoEntity>().in("status",0,1,4).orderBy(true,true,"order_num"));
        return mtCcTaskRunInfoEntities;
    }

    @Override
    public int selectRunning() {
        return mtCcTaskRunInfoDao.selectRunning();
    }

}